package com.hdax.dmw.item.api;

import com.hdax.dmw.dtos.item.IndexNavDto;
import com.hdax.dmw.item.service.DmItemTypeService;
import com.hdax.dmw.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping(path = "/index")
public class IndexNavApi {

    @Value("${server.port}")
    private String port;

    @Autowired
    private DmItemTypeService typeService;

    @PostMapping(path = "/nav")
    public Result<List<IndexNavDto>> nav(HttpServletRequest request) throws Exception{
        return typeService.nav();
    }
}
